<template>
	<view :style="themeColor">
		<view class="page">
			<view class="flex flex-direction flex-wrap align-stretch benben-position-layout flex shoppingIndex_flex_0"
				:style="{height:(215+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
				<view class='flex flex-wrap align-center justify-between shoppingIndex_fd0_0'>
					<!-- 	<view class='flex flex-wrap align-center shoppingIndex_fd0_0_c0' @tap.stop="handleJumpDiy"
						data-type="switchTab" :data-url="`/pages/tabBar/index/index`"> -->
					<view class='flex flex-wrap align-center shoppingIndex_fd0_0_c0'>
						<!-- <text class='fu-iconfont2  shoppingIndex_fd0_0_c0_c0'>&#xe794;</text> -->
					</view>
					<view class='flex flex-wrap align-center'>
						<text class='shoppingIndex_fd0_0_c1_c0'>无忧商城</text>
					</view>
					<view class='flex align-center justify-end shoppingIndex_fd0_0_c0'>
					</view>
				</view>
				<view class='flex flex-wrap align-center shoppingIndex_fd0_1' @tap.stop="handleJumpDiy"
					data-type="navigateTo" :data-url="`/pages/newShop/commodityList/commodityList`">
					<image class='shoppingIndex_fd0_1_c0' mode="aspectFit" :src='STATIC_URL+"338.png"'></image>
					<text class='shoppingIndex_fd0_1_c1'>请搜索你想要的商品</text>
				</view>

			</view>
			<view :style="{height: (215+StatusBarRpx)+'rpx'}"></view>
			<!---flex布局flex布局开始-->
			<view class="flex flex-wrap align-center justify-center benben-flex-layout shoppingIndex_flex_1">
				<view style="position: relative">
					<swiper ref="benbenSwiperfd1_0" :current='slide' @change="bannerIndexfd1_0 = $event.detail.current"
						class='flex position-relative shoppingIndex_fd1_0' previous-margin="0rpx" next-margin="0rpx"
						:display-multiple-items="1" :interval="5000" :duration="500" :autoplay='true' :circular='true'>

						<template v-for='(item,key0) in carouselList'>
							<swiper-item class='flex  shoppingIndex_fd1_0' :key='key0'>
								<image class='shoppingIndex_fd1_0_c1_c0' mode="scaleToFill" :src='item.thumb'
									@tap.stop="dynamicJump(item.href)"></image>
							</swiper-item>
						</template>

					</swiper>
					<view style="position: absolute"
						class="flex dot flex align-center justify-center shoppingIndex_swiperDotfd1_0">
						<template v-for="(item, index) in (carouselList.length)">
							<view :key="index" v-if="bannerIndexfd1_0 == index"
								class="flex dot selected flex align-center justify-center shoppingIndex_swiperDotSelectedfd1_0">
							</view>
							<view :key="index" v-else
								class="flex dot unselected flex align-center justify-center shoppingIndex_swiperDotUnselectedfd1_0">
							</view>
						</template>
					</view>
				</view>
			</view>

			<!---flex布局flex布局结束-->
			<!---flex布局flex布局开始-->
			<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout">
				<view class='flex flex-wrap align-center'>

					<scroll-view class='shoppingIndex_fd2_0_c0' :scroll-x='true' :show-scrollbar='true'>
						<view class='flex benben-scroll flex align-center'>
							<template v-for='(item,key0) in classificationList'>
								<view class='flex flex-direction flex-wrap align-center shoppingIndex_fd2_0_c0_c0'
									@tap.stop="handleJumpDiy" data-type="navigateTo"
									:data-url="`/pages/newShop/shopClassification/shopClassification?aid=${item.aid}`"
									:key='key0'>
									<image class='shoppingIndex_fd2_0_c0_c0_c0' mode="scaleToFill" :src='item.thumb'>
									</image>
									<text class='shoppingIndex_fd2_0_c0_c0_c1'>{{item.name}}</text>
								</view>
							</template>

						</view>
					</scroll-view>

					<view class='flex flex-direction flex-wrap align-center' @tap.stop="handleJumpDiy"
						data-type="navigateTo" :data-url="`/pages/newShop/shopClassification/shopClassification`">
						<image class='shoppingIndex_fd2_0_c1_c0' mode="aspectFit" :src='STATIC_URL+"406.png"'></image>
						<text class='shoppingIndex_fd2_0_c1_c1'>全部分类</text>
					</view>
				</view>
				<view class='flex flex-wrap align-center justify-center shoppingIndex_fd2_1'>
					<image class='shoppingIndex_fd2_1_c0' mode="aspectFit" :src='STATIC_URL+"34.png"'></image>
					<text class='shoppingIndex_fd2_1_c1' v-if="switchData.switch != 1">为你精选</text>
					<text class='shoppingIndex_fd2_1_c1' v-else>商品列表</text>
					<image class='shoppingIndex_fd2_1_c0' mode="aspectFit" :src='STATIC_URL+"35.png"'></image>
				</view>
			</view>

			<!---flex布局flex布局结束-->
			<!---订单列表flex布局开始-->
			<view class="flex flex-wrap align-center benben-flex-layout shoppingIndex_flex_3">
				<template v-for='(item,key0) in shopList'>
					<view class='flex flex-direction flex-wrap align-stretch shoppingIndex_fd3_0'
						@tap.stop="handleJumpDiy" data-type="navigateTo"
						:data-url="`/pages/newShop/goodsDetails/goodsDetails?shop_id=${item.aid}`" :key='key0'>
						<image class='shoppingIndex_fd3_0_c0' mode="scaleToFill" :src='item.thumb'></image>
						<view class='flex flex-direction flex-wrap align-stretch shoppingIndex_fd3_0_c1'>
							<text class='flex-sub shoppingIndex_fd3_0_c1_c0'>{{item.name}}</text>
							<view class='flex flex-wrap align-center shoppingIndex_fd3_0_c1_c1'>
								<text class='shoppingIndex_fd3_0_c1_c1_c0'>销量</text>
								<text class='flex-sub shoppingIndex_fd3_0_c1_c1_c1'>{{item.sales_sum}}</text>
							</view>
							<view class='flex flex-wrap align-end shoppingIndex_fd3_0_c1_c2'>
								<text class='shoppingIndex_fd3_0_c1_c2_c0'>￥</text>
								<text class=' shoppingIndex_fd3_0_c1_c2_c1'>
									<text
										class=' shoppingIndex_price1_fd3_0_c1_c2_c1'>{{ item.shop_price | frontPrice }}</text>
									<text
										class=' shoppingIndex_price2_fd3_0_c1_c2_c1'>{{ item.shop_price | laterPrice }}</text>
								</text>
								<text class='shoppingIndex_fd3_0_c1_c2_c2'>￥</text>
								<text class=' shoppingIndex_fd3_0_c1_c2_c3'>
									<text>{{ item.market_price | frontPrice }}</text>
									<text
										class=' shoppingIndex_price2_fd3_0_c1_c2_c3'>{{ item.market_price | laterPrice }}</text>
								</text>
							</view>
						</view>
					</view>
				</template>
				<fu-empty :pagingListLoadedAll="pagingListLoadedAll" :pagingListNoListData="pagingListNoListData"
					:listDataLength="listDataLength" :isLoadInit="isLoadInit"></fu-empty>
			</view>

			<!---订单列表flex布局结束-->
			<view class="flex benben-position-layout flex flex-wrap align-center shoppingIndex_flex_4"
				@tap.stop="handleJumpDiy" data-type="navigateTo"
				:data-url="`/pages/newShop/shopOrder/shopOrder?type=all`">
				<image class='shoppingIndex_fd4_0' mode="aspectFit" :src='STATIC_URL+"393.png"'></image>
			</view>
			<view
				class="flex flex-direction flex-wrap align-center justify-center benben-position-layout flex shoppingIndex_flex_5"
				@tap.stop="handleJumpDiy" data-type="navigateTo" :data-url="`/pages/newShop/shoppingCart/shoppingCart`">
				<image class='shoppingIndex_fd5_0' mode="aspectFit" :src='STATIC_URL+"394.png"'></image>
			</view>


		</view>
	</view>
</template>
<script>
	import pagingList from '@/common/mixin/paging_list.js';
	import {
		validate
	} from '@/common/utils/validate.js'

	export default {
		components: {},
		mixins: [pagingList],

		data() {
			return {
				"bannerIndexfd1_0": 0,
				"msgNum": {
					"order_num": "",
					"sys_num": "",
					"no_read_num": "",
					"new_order_message": "",
					"new_sys": "",
					"order_time": "",
					"sys_time": ""
				},
				"switchData": {
					"aid": "",
					"sys_num": "",
					"sys_time": ""
				},
				"minixPagingListsApi": "",
				"pageingListApiMethod": "",
				"allowOnloadGetList": false,
				"classificationList": [],
				"carouselList": [],
				"shopList": [],
				"slide": 0
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},
			isLogin() {
				return this.$store.state.token == '' ? false : true;
			},
			/**
			 * @returns 
			 * Android       安卓
			 * IOS       苹果
			 * Web       H5 或 pc
			 * Wechat       微信小程序
			 * Alipay       支付宝小程序
			 * Baidu       百度小程序
			 * ByteBounce       抖音小程序
			 * 360       360小程序
			 * FastApp       快应用
			 */
			appSystemIdentification() {
				return this.$store.state.appSystemIdentification
			}
		},
		watch: {},
		onLoad(options) {
			this.getShopFunc()
			this.getClassificationFunc()
			this.getCarouselFunc()
			uni.showShareMenu({
				withShareTicket: true,
				//设置下方的Menus菜单，才能够让发送给朋友与分享到朋友圈两个按钮可以点击
				menus: ["shareAppMessage", "shareTimeline"]
			})
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {
			this.getNoReadNumFuncFunc()
			this.getSwitchFunc()
		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {
			this.getShopFunc()
			this.getClassificationFunc()
			this.getCarouselFunc()
		},
		onShareAppMessage() {
			return {
				title: '高整无忧-数字家政平台',
				path: `/pages/tabBar/shoppingIndex/shoppingIndex`
			}
		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			//获取上架开关
			async getSwitchFunc() {
				//请求方法
				//数据验证

				let dataswitchData = await this.$api.get(global.apiUrls.post643e0feac967e, {

				});

				if (dataswitchData.data.code != 1) {
					this.$message.info(dataswitchData.data.msg);
					return
				}
				let infoswitchData = dataswitchData.data;
				this.switchData = infoswitchData.data
			},
			//获取商品列表
			getShopFunc() {
				this.minixPagingListsApi = global.apiUrls.post6459bde8ae548;
				this.pageingListApiMethod = 'get';
				this.allowOnloadGetList = false;
				this.pagingListPostDataContent = {}
				this.listData = [];
				this.shopList = this.listData;
				this.pagingListToggle();

			},
			//获取分类
			async getClassificationFunc() {
				//请求方法
				//数据验证

				let dataclassificationList = await this.$api.get(global.apiUrls.post63e36d0b9f651, {

				});

				if (dataclassificationList.data.code != 1) {
					this.$message.info(dataclassificationList.data.msg);
					return
				}
				let infoclassificationList = dataclassificationList.data;
				this.classificationList = infoclassificationList.data

			},
			//获取轮播
			async getCarouselFunc() {
				//请求方法
				//数据验证

				let datacarouselList = await this.$api.get(global.apiUrls.post636e02b419726, {
					operationadstype_id: '9'
				});

				if (datacarouselList.data.code != 1) {
					this.$message.info(datacarouselList.data.msg);
					return
				}
				let infocarouselList = datacarouselList.data;
				this.carouselList = infocarouselList.data

			},
			//获取未读消息数量
			async getNoReadNumFuncFunc() {
				if (this.isLogin === true) {
					//请求方法
					//数据验证
					let datamsgNum = await this.$api.get(global.apiUrls.post64140908ca17c, {

					});

					if (datamsgNum.data.code != 1) {
						this.$message.info(datamsgNum.data.msg);
						return
					}
					let infomsgNum = datamsgNum.data;
					this.msgNum = infomsgNum.data
					uni.setTabBarBadge({
						index: 4,
						text: this.msgNum.no_read_num
					})
				}
			},
			pagingListPostData() {
				return this.pagingListPostDataContent
			}
		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: rgba(248, 248, 248, 1);
		background-size: 100% auto;
	}

	.shoppingIndex_flex_0 {
		background: linear-gradient(180deg, #FF473A, #FF7C64);
		width: 750rpx;
		height: 215rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.shoppingIndex_fd0_1_c1 {
		margin: 0rpx 0rpx 0rpx 24rpx;
		font-size: 24rpx;
		font-weight: 400;
		color: rgba(153, 153, 153, 1);
	}

	.shoppingIndex_fd0_1_c0 {
		width: 32rpx;
		height: 32rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
	}

	.shoppingIndex_fd0_1 {
		background: #fff;
		width: 686rpx;
		height: 72rpx;
		border-radius: 45rpx 45rpx 45rpx 45rpx;
		background-size: 100% auto !important;
		padding: 0rpx 32rpx 0rpx 32rpx;
		margin: 20rpx 32rpx 0rpx 32rpx;
	}

	.shoppingIndex_fd0_0_c1_c0 {
		font-size: 36rpx;
		font-weight: 700;
		color: #fff;
	}

	.shoppingIndex_fd0_0_c0_c0 {
		color: var(--benbenFontColor3);
	}

	.shoppingIndex_fd0_0_c0 {
		width: 200rpx;
		height: 88rpx;
	}

	.shoppingIndex_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
		height: 88rpx;
	}

	.shoppingIndex_flex_1 {
		background: linear-gradient(180deg, #FF7C64, #F8F8F8);
		padding: 10rpx 0rpx 32rpx 0rpx;
		background-size: 100% auto !important;
		position: relative;
		margin: -10rpx 0rpx 0rpx 0rpx;
	}

	.shoppingIndex_numberfd1_0_c0 {
		background: #525050;
		position: absolute;
		bottom: 20rpx;
		right: 30rpx;
		width: 80rpx;
		height: 40rpx;
		border-radius: 6rpx 6rpx 6rpx 6rpx;
		font-size: 24rpx;
		color: #FFFFFF;
		line-height: 46rpx;
		font-weight: 400;
	}

	.shoppingIndex_fd1_0_c1_c0 {
		width: 702rpx;
		height: 280rpx;
		border-radius: 24rpx 24rpx 24rpx 24rpx;
	}

	.shoppingIndex_fd1_0 {
		width: 702rpx;
		height: 280rpx;
	}

	.shoppingIndex_swiperDotUnselectedfd1_0 {
		background: rgba(255, 255, 255, 0.5);
		width: 16rpx;
		height: 16rpx;
		border-radius: 100rpx 100rpx 100rpx 100rpx;
		margin: 0rpx 6rpx 0rpx 0rpx;
		font-size: 24rpx;
		color: #fff;
	}

	.shoppingIndex_swiperDotSelectedfd1_0 {
		background: #fff;
		width: 16rpx;
		height: 16rpx;
		border-radius: 100rpx 100rpx 100rpx 100rpx;
		margin: 0rpx 6rpx 0rpx 0rpx;
		font-size: 24rpx;
		color: #fff;
	}

	::v-deep .shoppingIndex_swiperDotfd1_0 {
		position: absolute;
		bottom: 20rpx;
		left: 0rpx;
		right: 0rpx;
	}

	.shoppingIndex_fd2_1_c1 {
		font-size: 36rpx;
		font-weight: 500;
		color: #333333;
		margin: 0rpx 24rpx 0rpx 24rpx;
	}

	.shoppingIndex_fd2_1_c0 {
		width: 60rpx;
		height: 29rpx;
	}

	.shoppingIndex_fd2_1 {
		margin: 32rpx 0rpx 16rpx 0rpx;
	}

	.shoppingIndex_fd2_0_c1_c1 {
		font-size: 24rpx;
		font-weight: 400;
		color: #333333;
		margin: 16rpx 0rpx 0rpx 0rpx;
		max-width: 112rpx;
		-webkit-line-clamp: 1;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
	}

	.shoppingIndex_fd2_0_c1_c0 {
		width: 110rpx;
		height: 110rpx;
	}

	.shoppingIndex_fd2_0_c0_c0_c1 {
		font-size: 24rpx;
		font-weight: 400;
		color: #333333;
		margin: 16rpx 0rpx 0rpx 0rpx;
		max-width: 112rpx;
		-webkit-line-clamp: 1;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		line-height: 33rpx;
	}

	.shoppingIndex_fd2_0_c0_c0_c0 {
		width: 112rpx;
		height: 112rpx;
		border-radius: 56rpx 56rpx 56rpx 56rpx;
	}

	.shoppingIndex_fd2_0_c0_c0 {
		margin: 0rpx 38rpx 0rpx 0rpx;
	}

	.shoppingIndex_fd2_0_c0 {
		touch-action: none;
		width: 600rpx;
		padding: 0rpx 0rpx 0rpx 22rpx;
	}

	.shoppingIndex_flex_3 {
		padding: 12rpx 19rpx 12rpx 19rpx;
	}

	.shoppingIndex_price2_fd3_0_c1_c2_c3 {
		font-size: 24rpx;
	}

	.shoppingIndex_fd3_0_c1_c2_c3 {
		color: #999999;
		font-size: 24rpx;
		font-weight: 400;
		text-decoration: line-through;
	}

	.shoppingIndex_fd3_0_c1_c2_c2 {
		font-size: 24rpx;
		font-weight: 400;
		color: #999999;
		margin: 0rpx 0rpx 0rpx 8rpx;
		text-decoration: line-through;
	}

	.shoppingIndex_price2_fd3_0_c1_c2_c1 {
		font-size: 22rpx;
	}

	.shoppingIndex_price1_fd3_0_c1_c2_c1 {
		font-size: 32rpx;
		font-weight: 700;
		color: #FF4133;
	}

	.shoppingIndex_fd3_0_c1_c2_c1 {
		color: #ff5536;
		font-weight: 600;
		font-size: 32rpx;
	}

	.shoppingIndex_fd3_0_c1_c2_c0 {
		font-size: 22rpx;
		font-weight: 700;
		color: #FF4133;
	}

	.shoppingIndex_fd3_0_c1_c2 {
		line-height: 32rpx;
	}

	.shoppingIndex_fd3_0_c1_c1_c1 {
		font-size: 24rpx;
		font-weight: 400;
		color: #999999;
		-webkit-line-clamp: 1;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		line-height: 33rpx;
	}

	.shoppingIndex_fd3_0_c1_c1_c0 {
		color: #999999;
		font-size: 24rpx;
		font-weight: 400;
		line-height: 33rpx;
	}

	.shoppingIndex_fd3_0_c1_c1 {
		margin: 16rpx 0rpx 24rpx 0rpx;
	}

	.shoppingIndex_fd3_0_c1_c0 {
		-webkit-line-clamp: 2;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		font-size: 28rpx;
		font-weight: 500;
		color: #333333;
		min-height: 72rpx;
	}

	.shoppingIndex_fd3_0_c1 {
		margin: 24rpx 16rpx 24rpx 16rpx;
	}

	.shoppingIndex_fd3_0_c0 {
		width: 346rpx;
		height: 346rpx;
		border-radius: 16rpx 16rpx 0rpx 0rpx;
	}

	.shoppingIndex_fd3_0 {
		background: #fff;
		background-size: 100% auto !important;
		border-radius: 24rpx 24rpx 24rpx 24rpx;
		margin: 0rpx 10rpx 16rpx 0rpx;
		width: 346rpx;
	}

	.shoppingIndex_flex_4 {
		width: 80rpx;
		height: 80rpx;
		overflow: hidden;
		z-index: 10;
		bottom: calc(600rpx + var(--window-bottom));
		right: 32rpx;
	}

	.shoppingIndex_fd4_0 {
		width: 80rpx;
		height: 80rpx;
	}

	.shoppingIndex_flex_5 {
		width: 80rpx;
		height: 80rpx;
		overflow: hidden;
		z-index: 10;
		bottom: calc(700rpx + var(--window-bottom));
		right: 32rpx;
	}

	.shoppingIndex_fd5_0 {
		width: 80rpx;
		height: 80rpx;
	}
</style>